<?class desktop extends base{
  function __construct()
  {
    parent::__construct();
    $this->m = load('m/calender');
  }
  
  function index()
  {
    $param['anno'] = load('m/announce')->get(" order by id desc",1,5);

    $uid = $this->uid;
    $today = date('Y-m-d');
    $tomorrow = date('Y-m-d', time() + 3600*24);
    //echo " and uid='$uid' and date in($today,$tomorrow)";
    $cal = array($today=>array(),$tomorrow=>array());
    $cals = load('m/calender')->get(" and uid='$uid' and date in( '$today','$tomorrow')");
    foreach($cals as $c){
      if($c['date'] == $today) $cal[$today] = $c;
      else $cal[$tomorrow] = $c;
    }
    $param['cal']  = $cal;
    $this->display('home/index',$param);
  }
}
